package pl.marekbar.widoki;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class DropDownAdapter extends ArrayAdapter<String>
{

	// Your sent context
	private Context context;
	// Your custom values for the spinner (User)
	private String[] values;



	public DropDownAdapter(Context context, int textViewResourceId, String[] values)
	{
		super(context, textViewResourceId, values);
		this.context = context;
		this.values = values;
	}



	public int getCount()
	{
		return values.length;
	}



	public String getItem(int position)
	{
		return values[position];
	}



	public long getItemId(int position)
	{
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		TextView label = new TextView(context);
		label.setTextColor(Color.BLACK);
		label.setText(values[position]);
		return label;
	}

	@Override
	public View getDropDownView(int position, View convertView, ViewGroup parent)
	{
		TextView label = new TextView(context);
		label.setTextColor(Color.BLACK);
		label.setText(values[position]);
		return label;
	}
}
